﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MasterForum : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void BLogin_Click(object sender, EventArgs e)
    {
            Lris.Visible = true;
            var ris = DB.selectQuery("ForumDB", "select count(*) from userForum where username='" + TBnome.Text + "' and password='" + TBpassword.Text + "'");


            if (ris[0][0]=='1')
            {
                Lris.Text = "Loggato con successo";
                utenteCore user = new utenteCore();

                user.username = TBnome.Text;
                Session["UtenteCore"] = user;
                Session["islogged"] = true;
            }
            else {

                Lris.Text = "Password e/o id sbagliati";
            }

        

    }

}
